package com.example.lotteryticketdev.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.lotteryticketdev.dao.BallDao;
import com.example.lotteryticketdev.entity.Ball;
import com.example.lotteryticketdev.result.Result;
import com.example.lotteryticketdev.service.BallService;
import com.example.lotteryticketdev.tool.MyReflect;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * (Ball)表服务实现类
 *
 * @author makejava
 * @since 2023-09-24 14:33:02
 */
@Service("ballService")
public class BallServiceImpl extends ServiceImpl<BallDao, Ball> implements BallService {

    @Override
    public Result updateBallById(Ball ball) {
        Ball temp = this.baseMapper.selectById(ball.getId());
        Ball o = (Ball) MyReflect.setForNotNull(ball, temp);
        int insert = this.baseMapper.updateById(o);
        return insert == 1 ? Result.ok() : Result.fail();
    }


}

